﻿using Inovout.Kuajing.Exports.Models;
using Inovout.Services;
using NHibernate.Criterion;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Inovout.Kuajing.Exports.Services
{
    public class CommodityService : RepositoryService<ExportCommodity>, ICommodityService
    {

        public IList<ExportCommodity> FindCommodityByExporter(Exporter exporter)
        {
            if (exporter != null)
            {
                return base.Repository.FindAll(Restrictions.Eq("Exporter.Id", (object)exporter.Id));
            }
            else {
                return base.Repository.FindAll();
            }
        }

    }
}
